chore: drop cloud-provider-gcp dependency and fork NewAltTokenSource#18274
Merged
k8s-ci-robot merged 3 commits intokubernetes:masterfrom May 5, 2026
Merged
chore: drop cloud-provider-gcp dependency and fork NewAltTokenSource#18274k8s-ci-robot merged 3 commits intokubernetes:masterfrom
k8s-ci-robot merged 3 commits intokubernetes:masterfrom
Conversation
clouddns is the only kops package that imports cloud-provider-gcp, and it uses exactly one helper: gce.NewAltTokenSource. The full module pulls in compute/v0.alpha and compute/v0.beta along with k8s-cloud-provider, none of which kops touches. Fork the AltTokenSource type from k8s.io/cloud-provider-gcp/providers/gce/token_source.go at v32.4.0 into third_party/forked/gcetokensource. The Prometheus counters and their legacyregistry registration are dropped; everything else is preserved verbatim. Signed-off-by: Ciprian Hacman <ciprian@hakman.dev>
clouddns is now the only kops consumer of the fork; cloud-provider-gcp and the GoogleCloudPlatform/k8s-cloud-provider chain that came with it fall out, and so do the unused google.golang.org/api/compute/v0.alpha and v0.beta SDKs. Signed-off-by: Ciprian Hacman <ciprian@hakman.dev>
`make gomod` propagates the dropped indirect deps from the main module to the tests/e2e submodule. Signed-off-by: Ciprian Hacman <ciprian@hakman.dev>
Member
Author
|
/retest |
rifelpet
approved these changes
May 5, 2026
Contributor
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rifelpet The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The kOps Cloud DNS provider only used
k8s.io/cloud-provider-gcpfor one helper:gce.NewAltTokenSource, an OAuth2TokenSourcethat mints access tokens by POSTing to a configurable URL. That single function pulled in:k8s.io/cloud-provider-gcp/providers/gce(the whole GCE cloud-provider)github.com/GoogleCloudPlatform/k8s-cloud-providergoogle.golang.org/api/compute/v0.alphaandcompute/v0.beta(onlycompute/v1is actually used by kOps)k8s.io/cloud-provider/volume,google.golang.org/api/{container,networkservices,tpu}, etc.None of that machinery is used at runtime —
NewAltTokenSourceonly needsoauth2,oauth2/google,googleapi, andclient-go/util/flowcontrol, all of which kOps already depends on directly or transitively.Following the convention from #18230 and #18272, fork
NewAltTokenSourceintothird_party/forked/gcetokensource. The Prometheus counters and theirlegacyregistryregistration are dropped (kOps doesn't expose component-base metrics from this path); everything else is preserved verbatim.Impact
dnsprovider/.../clouddns.go4-line import/call swapk8s.io/cloud-provider-gcp,github.com/GoogleCloudPlatform/k8s-cloud-provider,google.golang.org/api/compute/v0.alpha,google.golang.org/api/compute/v0.beta, plus various transitive helpersAssisted by Claude Opus
/cc @rifelpet @justinsb